<?php

namespace app\adminapi\logic\setting\lang;

use app\common\enum\DefaultEnum;
use app\common\logic\BaseLogic;
use app\common\model\lang\{LangCountry, LangType};
use app\common\service\ConfigService;
use think\facade\Db;

/**
 * 语言逻辑层
 * Class LangLogic
 * @package app\adminapi\logic\setting
 */
class LangCountryLogic extends BaseLogic
{

    /**
     * 获取所有国际语言
     * @return array
     */
    public static function getLangCountryAll()
    {
        $newList = [];
        $list = LangCountry::order('id asc')->select()->toArray();
        foreach ($list as $k => $item) {
            $newList[] = [
                'value' => $item['code'],
                'label' => $item['name'] . "[ " . $item['code'] . " ]",
            ];
        }
        return $newList;
    }

}